package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.Shop;
import com.ruoyi.system.api.factory.RemoteShopFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * 用户服务
 */
@FeignClient(contextId = "remoteShopService", value = ServiceNameConstants.SHOP_SERVICE, fallbackFactory = RemoteShopFallbackFactory.class)
public interface RemoteShopService {
    /**
     * 通过用户名查询用户信息
     *
     * @param source 请求来源
     * @return 结果
     */
    @GetMapping("/shop/{shopsId}")
    R<Shop> getByShopsId(@PathVariable("shopsId") Long shopsId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);


}
